#include "Exceptions.h"
namespace GxLibBasic
{
	Exception::Exception(const Exception & e)
	{
		Text = e.Text;
		LineNumber = e.LineNumber;
		SrcName = e.SrcName;
	}

	Exception::Exception(String EText, String src, Int line)
		:Text(EText),SrcName(src),LineNumber(line)
	{
	};

	Exception::Exception(String src, Int line)
		:Text(src),SrcName(src),LineNumber(line)
	{

	};

	gxMemAllocException::gxMemAllocException(String src, Int line)
	:Exception(L"Memory exception: cannot allocate memory resource.",src,line)
	{
	};

	gxIndexOutOfRangeException::gxIndexOutOfRangeException(String src, Int line)
	:Exception(L"Array exception: index out of range.",src,line)
	{
	};

	gxFileSystemException::gxFileSystemException(String FileName, String src, Int line)
	:Exception(src,line)
	{
		Text = L"File IO Exception: ";
		Text += FileName;
	};

	gxDllLinkException::gxDllLinkException( String DllName, String src /*= L""*/, Int Line /*=0*/ )
	:Exception(src,Line)
	{
		Text = String(L"Cannot load library \"") + DllName + L"\"";
	}

}